<template>
  <div class="dy-main InsuranceOrderCancelQuery">
    <div class="dy-header">
       <x-header :right-options="{showMore: false}" :left-options="{preventGoBack:true}" @on-click-back="back">交易查询</x-header>
    </div>
    <div class="dy-body">
      <div class="dltable">
        <group gutter="0">
          <cell :title="('产品名称')" :value="RiskName"></cell>
          <cell :title="('产品名称')" :value="InsuranceNumber"></cell>
          <cell :title="('投保公司')" :value="InsuranceCompany"></cell>
          <cell :title="('投保日期')" :value="InsuranceData"></cell>
          <cell :title="('保单状态')" :value="InsuranceStt"></cell>
          <cell :title="('购买渠道')" :value="BuyChannel"></cell>
        </group>
      </div>
      <div @click="OrderCancer" class="insurance-cancer-btn">撤单</div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      RiskName: '',
      InsuranceNumber: '',
      InsuranceCompany: '',
      InsuranceData: '',
      InsuranceStt: '',
      BuyChannel: '',
      status: ''
    }
  },
  methods: {
    goNext (a) {
      alert(a)
    },
    refreshOption () {
      let self = this
      this.$bridge.callhandler('nativeRequest',
        JSON.stringify({
          'requstSource': 'internetRequest',
          'url': 'mstep.do?act=business',
          'params': {'method_Name': 'InsuranceTradeQuery'}
        }),
        function (response) {
          response = JSON.parse(response)
          if (response.status === 0 || response.status === '0') {
            let data = response.data.data[0]
            self.RiskName = data.RiskName
            self.InsuranceNumber = data.InsuranceNumber
            self.InsuranceCompany = data.InsuranceCompany
            self.InsuranceData = data.InsuranceData
            self.InsuranceStt = data.InsuranceStt
            self.BuyChannel = data.BuyChannel
            self.status = data.status
          } else {
            alert('fail')
          }
        }
      )
    },
    OrderCancer () {
      this.$router.push({name: 'InsuranceOrderCancelConfirm', query: {'RiskName': this.RiskName, 'InsuranceNumber': this.InsuranceNumber, 'InsuranceCompany': this.InsuranceCompany, 'InsuranceData': this.InsuranceData, 'InsuranceStt': this.InsuranceStt, 'BuyChannel': this.BuyChannel}})
    },
    back () {
      this.$publicFun.goBack(this)
    }
  },
  created () {
    this.refreshOption()
  }
}
</script>

<style lang="less">
.InsuranceOrderCancelQuery{
  .dy-body{
    .dltable{
      padding-top: 0.2rem;
    }
    .insurance-cancer-btn{
      width: 6.9rem;
      height: .88rem;
      margin: .69rem auto;
      background-color: #EC1B30;
      font-size: .34rem;
      color: #FFFFFF;
      line-height: .88rem;
      text-align: center;
      border-radius: .06rem;
    }
  }
}
</style>
